package demo04;

/**
 * @author JYH
 * @version 1.0
 * @date 2022/10/25 16:07
 */
public class Test {
    public static void main(String[] args) {

        UPan<String> u = new UPan<>();
        u.usb("优盘");

        Mouse mouse = new Mouse();
        mouse.usb("鼠标");
    }
}
interface USB<T>{
    public void usb(T t);
}
//第一种实现泛型接口
class UPan<T> implements USB<T>{

    @Override
    public void usb(T t) {
        System.out.println(t+"是泛型");
    }
}
//第二种实现泛型接口
class Mouse implements USB<String>{

    @Override
    public void usb(String s) {
        System.out.println(s+"不是泛型");
    }
}